package com.example.consumer.utils;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class DateTimeUtil {

    public static String getDateTime(String format) {
        Calendar calendar = Calendar.getInstance();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(format);
        return simpleDateFormat.format(calendar.getTime());
    }

    public static String getCurrentDateTime() {
        return getDateTime("yyyy-MM-dd HH:mm:ss");
    }
}
